package priv.pront.code.national.acwing.graph;

import java.util.*;

public class A848_有向图的拓扑排序 {

    static int n, m, idx, cnt = 0;
    static int[] e, ne, h, top, d;
    static Queue<Integer> queue = new LinkedList<>();

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        m = scanner.nextInt();
        top = new int[n];
        e = new int[m + 1];
        ne = new int[m + 1];
        d = new int[100010];
        h = new int[n + 1];
        Arrays.fill(h, -1);
        for (int i = 0; i < m; i++) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            add(a, b);
            d[b]++;
        }
        if (topSort()) {
            for (int i : top) System.out.print(i + " ");
        } else {
            System.out.println(-1);
        }

    }

    private static void add(int a, int b) {
        e[idx] = b;
        ne[idx] = h[a];
        h[a] = idx++;
    }

    private static boolean topSort() {
        for (int i = 1; i <= n; i++) {
            if (d[i] == 0) queue.offer(i);
        }

        while (!queue.isEmpty()) {
            int t = queue.poll();
            top[cnt] = t;
            cnt++;
            for (int i = h[t]; i != -1; i = ne[i]) {
                int j = e[i];
                if (--d[j] == 0) queue.offer(j);
            }
        }
        return cnt >= n;
    }
}
